using System;
using dnAnalytics.Nli;

/// <summary>
/// Swap every other element starting with the first element.
/// </summary>
internal class Program {
	[STAThread]
	private static void Main() {
		//use the MKL BLAS provider
		IBlas blas = Blas.Provider(BlasProvider.Mkl);
		
		//vectors to swap values
		double[] x = new double[] {0, 0, 0, 0, 0, 0, 0, 0};
		double[] y = new double[] {1, 1, 1, 1, 1, 1, 1, 1};

		//call Dswap
		blas.Dswap(4, x, 2, y, 2);

		foreach(double value in x) {
			Console.WriteLine(value);
		}
		Console.WriteLine();
		foreach(double value in y) {
			Console.WriteLine(value);
		}
		/* 
		Output:
		1
		0
		1
		0
		1
		0
		1
		0

		0
		1
		0
		1
		0
		1
		0
		1
		*/
	}
}